import Vue from 'vue'

let page = {
  total: 1,
  startIndex: 0,
  stepNumber: 40,
  currentPage: 1
};


let data={
  productList:[],
  tabs:[]
}
let status={

}
let params={
  operation:"0",
  productCode:'',
  selectedTabId:'',
  selection:[],
  productName:''
}
let table=[
   {
      type: 'selection',
      width: 55,
      align: 'center',
      fixed: 'left'
    },
  {
    type: 'index',
    width: 55,
    align: 'center',
    fixed: 'left'
  },
    {
      title: 'SKU',
      key: 'code',
      width: 140,
      align: 'center',
      render: (h, params) => {
        var productUrl = Vue.prototype.$tiyProductUrl(params.row.code);
        return h('div',[h('a',{
          attrs:{href:productUrl,target:'_blank'}
        },params.row.code)]);
      }

    },
  {
    title: '产品名',
    key: 'name',
    // width: 100,
    align: 'left'
  },

    {
      title: '产品图片',
      key: 'listImgUrl',
      width: 180,
      render: (h, params) => {
        let yunPath = Vue.prototype.$store.getters.imgPrefix;
        let imageUrl = params.row.productImg;
        return imageUrl==''||imageUrl==null ? '' : h('img', {
          attrs: {src: imageUrl, height: 60},
          on: {
            click: () => {
              status.modalImage.url = imageUrl;
              status.modalImage.isShow = true;
            }
          }
        })
      },
      align: 'center'
    },
    {
      title: '产品价格',
        key: 'currentPrice',
      width: 100,
      align: 'center'
    },
  ]


export  default  {
  tPage: page,
  tStatus: status,
  tParam: params,
  tData: data,
  tTable: table,
};
